Skip to content

Conversation

@jonbarrow
Copy link
Member

@jonbarrow jonbarrow commented Sep 30, 2025

Resolves #XXX

Changes:

This is the start of BFRES parsing support. Marking as a draft for now because there's still a lot to do

Currently I am only aiming to get this functional enough to export the Mii models mentioned in #2 into a GLB. Full BFRES spec support can come later

Currently this can ALMOST export models to OBJ files, it's just missing the ability to create the face triangles. Nowhere near GLB ready though, since no skeletons or animations are being parsed right now

This is required for future Mii rendering

@jonbarrow jonbarrow changed the title feat(stream): add signed int support BFRES Sep 30, 2025
@jonbarrow jonbarrow mentioned this pull request Sep 30, 2025
13 tasks
@jonbarrow
Copy link
Member Author

@ariankordi can you confirm something for me real fast? I think I have things in a state where models can start to be exported, but my Mii sample models look very strange

I'm checking MiiBodyHigh in this example, and it has 2 FMDLs:

  • MaleBody
  • FemaleBody

Inside each there are 2 FSHPs:

  • shape0
  • shape1

When exporting these to an OBJ (for testing purposes right now), it looks like shape0 is exported just fine but shape1 is very broken? Also shape0 has the arms and hands in very odd positions?

Is this normal?

Screenshots from blender:

shape0

Screenshot 2025-09-30 at 11 01 01 PM Screenshot 2025-09-30 at 11 00 49 PM Screenshot 2025-09-30 at 11 00 42 PM

shape1

Screenshot 2025-09-30 at 11 00 32 PM

shape0 and shape1 visible at the same time

Screenshot 2025-09-30 at 11 00 24 PM

@ariankordi
Copy link

Those limbs look normal, that's the bind pose for this model. You can see this by downloading this glTF, opening it in https://gltf-viewer.donmccurdy.com and disabling the animation.

Yeah, for shape1 you may have broken.. indices? IDK.

@ariankordi
Copy link

ariankordi commented Oct 1, 2025

I'll also point out that MiiBodyMiddle is the only one that's used, if you need to cross-compare. I'm going to document how to do this with RenderDoc + Cemu since I don't think anyone on the internet has. If you look at the attributes, they're in these strange numbers instead of the floats you'd expect.
image
The "VS Input" is the half-float (in this case) data, but big-endian. So, 32963 = 0x80C3 = 0xC380 = -3.75.

Here's a script I vibe coded to convert this specific model from CSV: https://gist.github.com/ariankordi/dbf23458668de417b19d3b1757981ae5

@jonbarrow
Copy link
Member Author

I'll also point out that MiiBodyMiddle is the only one that's used, if you need to cross-compare

That actually helped a lot. Switching to that, I can see that the FSHPs are named body_mt_body and body_mt_pants. body_mt_pants is the one that's fucked up, it looks like I'm trying to apply the bodies shape to the pants....? Really not sure what's going on there tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants